import {
    FETCH_LOADING,
    LEFT_MENU
} from './mutation-types'
import {
    user
} from '../api/user/user'

export default {
    fetchLoading({ commit, state }, bool){
        commit(FETCH_LOADING, bool);
    },
    async getLeftMenuData({ commit, state }){
        try{
            let userRole = await getUserRoleById(state.user.userId)
            commit(LEFT_MENU, userRole);
        }catch(e){
            console.log(e)
        }
    }
}